
<div class="content content-bot">
    <form id="editForm" class="visitors" style="margin: auto;">
        <input type="hidden" name="id" value="<?php echo $output['info']['id']; ?>">
        <div class="visitors-list">
            <label>游客姓名</label>
            <input type="text" name="name" value="<?php echo $output['info']['mb_name']; ?>" placeholder="请填写真实姓名" />
        </div>
        <div class="visitors-list">
            <label>手机号</label>
            <input type="text" name="phone" value="<?php echo $output['info']['mb_phone']; ?>" placeholder="用于接收确认短信" />
            <i class="iconfont "></i>
        </div>
        <div class="visitors-list">
            <label>身份证号</label>
            <input type="text" name="idcard" value="<?php echo $output['info']['mb_idcard']; ?>" placeholder="请填写有效证件号码" />
            <i class="iconfont "></i>
        </div>
    </form>
</div>
<div class="btn-div">
    <a class="btn" id="save">保存</a>
</div>

<script>
    $(function () {
        var form = $('#editForm');
        $('#save').click(function () {
            var name = $.trim(form.find('input[name="name"]').val()),
                phone = $.trim(form.find('input[name="phone"]').val());
            if (name == '') {
                popAlert('姓名不能为空');
                return;
            } else if (!(/^1\d{10}/.test(phone))) {
                popAlert('手机号码不正确');
                return;
            } else {
                $.post('index.php?act=ticket&op=update_info', form.serialize(), function (ret) {
                    console.log(ret);
                    if (ret.res) {
                        closeEdit();
                        openSel();
                    }
                }, 'json');
            }
        });
    });
</script>